package com.zq.controller;

import com.zq.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
  /*  @RequestMapping("/hello.do")
    public ModelAndView hello(){
        System.out.println(1111);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("hello","SpringMVC is Very good");
        modelAndView.setViewName("/WEB-INF/jsp/success.jsp");
        return modelAndView;
    }*/
  @GetMapping("/hello.do")
  @ResponseBody
  public User hello(){
      User user = new User(1,"张强",26);
      System.out.println(user);
      return user;
  }
}
